package com.google.gwt.livinglife.client;

import java.util.HashSet;
import java.util.Iterator;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.livinglife.client.data.*;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DeckPanel;
import com.google.gwt.user.client.ui.DecoratedPopupPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class MyGroupsPanel {
	VerticalPanel main_panel = new VerticalPanel();
	HorizontalPanel search_group_container = new HorizontalPanel();
	ConciseGroupListWidget group_list = new ConciseGroupListWidget();
	VerticalPanel group_displayPanel = new VerticalPanel();
	// Elements for displaying a group

	public MyGroupsPanel() {
		main_panel.add(search_group_container);
		search_group_container.setHorizontalAlignment((HasHorizontalAlignment.ALIGN_RIGHT));
		main_panel.add(group_list);
		
	}
	
	public void showGroups(HashSet<GroupIdData> groups) {
		group_list.clear();
		Iterator<GroupIdData> iterator = groups.iterator();
		while(iterator.hasNext()) {
			group_list.addGroup(iterator.next());
		}
	}
	public VerticalPanel getMain_panel() {
		return main_panel;
	}
}
